/**
  ******************************************************************************
  * File Name          : ModbusMaster.h
  * Description        : ModbusMaster协议相关处理文档
  *
  ******************************************************************************
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MODBUS_MASTER_H__
#define __MODBUS_MASTER_H__


/* Includes ------------------------------------------------------------------*/

#include "string.h"
#include "alldefine.h"
#include "SysUart.h"
#include "Config.h"
#include "CrcCheck.h"
#include "SysUtcTime.h"
#include "SysTick.h"


/* define ------------------------------------------------------------------*/

#define MASTERSIZE	10


/* Exported typedef ------------------------------------------------------------------*/


/*
* MODBUS MASTER处理状态
*/
 
typedef enum
{
    MASTER_STATE_IDLE=0,
    MASTER_STATE_SEND,
    MASTER_STATE_WAIT,
    MASTER_STATE_TIMEOUT,
    MASTER_STATE_RECIVE_DOWN
}sMASTERStates;




typedef enum
{
  MASTERUINT16=0,
	MASTERUINT16_X10,
	MASTERUINT16_X100,
	MASTERINT16,
	MASTERINT16_X10,
	MASTERINT16_X100,
	MASTERUINT32,
	MASTERINT32,
	MASTERFLOAT_CDAB,
	MASTERFLOAT_ABCD
}sModbusMasterDataDef;


typedef struct
{
	uint16_t		Status;//是否启用
	uint16_t		SlaveId;//从机ID
	uint16_t		SlaveCmd;//命令字
	uint16_t		SlaveAddr;//寄存器地址
	uint16_t		SlaveType;//数据格式
}sModbusMasterSetDef;



/* struct data ------------------------------------------------------------------*/

//uint16_t	*MasterValue;


/* Function ------------------------------------------------------------------*/

	
extern void ModbusMasterTask(void);

#endif /*__ pinoutConfig_H */

/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT INLEEQ *****END OF FILE****/


